<?php  if( !defined("IN_IA") ) 
{
	exit( "Access Denied" );
}
class Log_UnporBabyComModel extends ComModel
{
	public function skuLog($op_type = '0', $w_goodsid = '0', $num = '0', $remark = "", $from = array(), $wid = '0'){
		global $_W;
		if(empty($wid)){
			$wid = $_W['warehouse']['id'];
		}
		if($num == '0'){
			return true;
		}
		$insertArr = array(
			'uniacid'		=>	$_W['uniacid'],
			'wid'			=>	$wid,
			'w_goodsid'		=>	$w_goodsid,
			'num'			=>	$num,
			'remark'		=>	$remark,
			'createtime'	=>	TIMESTAMP,
			'op_type'		=>	$op_type,
			'order_id'		=>	intval($from['order_id']),
			'purchase_id'	=>	intval($from['purchase_id'])
		);
		pdo_insert("imfox_eos_warehouse_skulog", $insertArr);
	}
	public function orderLog($orderid, $goodsInfo = array(), $edit_type = '1', $valueArr = array(), $wid = '0'){
		global $_W;
		if(empty($wid)){
			$wid = $_W['warehouse']['id'];
		}
		$insertArr = array(
			'uniacid'			=>	$_W['uniacid'],
			'wid'				=>	$wid,
			'orderid'			=>	$orderid,
			'w_goodsid'			=>	$goodsInfo['w_goodsid'],
			'goodsname'			=>	$goodsInfo['goodsname'],
			'edit_type'			=>	$edit_type,
			'old_num'			=>	$valueArr['old_num'],
			'new_num'			=>	$valueArr['new_num'],
			'old_price'			=>	$valueArr['old_price'],
			'new_price'			=>	$valueArr['new_price'],
			'old_totalprice'	=>	$valueArr['old_totalprice'],
			'new_totalprice'	=>	$valueArr['new_totalprice'],
			'createtime'		=>	TIMESTAMP,
			'operator'			=>	$_W['uid']
		);
		pdo_insert("imfox_eos_order_log", $insertArr);
	}
}